<!--
 * @Author: your name
 * @Date: 2022-01-10 09:20:28
 * @LastEditTime: 2022-11-10 14:32:42
 * @LastEditors: YanMeng
 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 * @FilePath: \ias_ui\src\views\coi\commodityM\components\searchHead.vue
-->
<template>
  <div class="app-container">
    <el-collapse v-model="activeName" accordion>
      <el-collapse-item name="1">
        <template slot="title"> <i class="el-icon-search" />&nbsp;搜索栏 </template>
        <div class="head-container">
          <el-form class="searchform" :inline="true" size="mini" label-width="130px">
            <el-form-item label="UPC(不含检验码)">
              <el-input v-model="searchData.skuList" type="textarea" placeholder="请输入UPC(不含检验码)，多个回车换行隔开" clearable style="width: 200px" />
            </el-form-item>
            <el-form-item v-if="goodsLibrary" label="部门">
              <el-input v-model="searchData.deptNbr" placeholder="请输入部门" clearable style="width: 200px" />
            </el-form-item>
            <el-form-item label="Fineline">
              <el-input v-model="searchData.finelineNbrList" type="textarea" placeholder="输入Fineline，多个回车换行隔开" clearable style="width: 200px" />
            </el-form-item>
            <el-form-item label="是否带赠品">
              <el-select v-model="searchData.giveawayFlag" style="width: 200px" placeholder="请选择" clearable>
                <el-option label="是" :value="1" />
                <el-option label="否" :value="0" />
              </el-select>
            </el-form-item>
            <el-form-item label="商品名称">
              <el-input v-model.trim="searchData.skuName" placeholder="请输入商品名称" clearable style="width: 200px" />
            </el-form-item>
            <el-form-item label="建品供应商号">
              <el-input v-model="searchData.buildVendorNbr" placeholder="请输入建品供应商号" clearable style="width: 200px" />
            </el-form-item>
            <el-form-item label="建品供应商名称">
              <el-input v-model.trim="searchData.buildVendorName" placeholder="请输入建品供应商名称" clearable style="width: 200px" />
            </el-form-item>
            <el-form-item label="存储方式">
              <el-select v-model="searchData.warmZoneLabel" style="width: 200px" placeholder="请选择存储方式" clearable>
                <el-option v-for="item in warmZoneLabel" :key="item.value" :label="item.label" :value="item.value" />
              </el-select>
            </el-form-item>
            <el-form-item label="是否存在详情页">
              <el-select v-model="searchData.hasContentFlag" style="width: 200px" placeholder="请选择" clearable>
                <el-option label="是" :value="1" />
                <el-option label="否" :value="2" />
              </el-select>
            </el-form-item>
            <el-form-item label="">
              <el-button id="searchBtn" size="mini" type="primary" icon="el-icon-search" round @click="$emit('search')">查询</el-button>
              <el-button id="resetBtn" size="mini" type="primary" icon="el-icon-refresh" round @click="$emit('reset')">重置</el-button>
              <el-button size="mini" icon="el-icon-download" type="primary" round @click="$emit('download')">导出</el-button>
            </el-form-item>
          </el-form>
        </div>
      </el-collapse-item>
    </el-collapse>
  </div>
</template>

<script>
import { warmZoneLabel } from '@/views/coi/commonJs/dictionary'

export default {
  name: 'CommodityLibrarySearchHead',
  props: {
    searchData: {
      type: Object,
      default: () => {
        return {}
      }
    },
    goodsLibrary: {
      type: Boolean,
      default: false
    }
  },
  data() {
    return {
      warmZoneLabel,
      activeName: '1'
    }
  }
}
</script>

<style lang="scss" scoped>
.app-container {
  padding-bottom: 8px;
}
/deep/ .el-form-item {
  margin-right: 0;
}
</style>
